1. Field of the Invention
The present invention relates to an image forming apparatus and an image processing method that can convert image data of M (M>N) gradations into image data of N (N>3) gradations, and also relates to a computer-readable storage medium storing a program to enable an apparatus to execute the image processing method.
2. Description of the Related Art
For example, when a printer processes image data to be printed that have pixel values of multiple gradations (e.g., 256 gradations), the printer performs halftone processing on the image data to change the gradations of the pixel values according to the number of output gradations of the printer. In general, a multi-level dither method is usable to convert the multi-gradational data into 4-bit or lower data.
The multi-level dither method includes storing, in a memory, threshold matrices each having an arbitrary size, as illustrated in FIG. 10, by an amount corresponding to the number of output gradations of a printer (e.g., 15 matrices for 4-bit data) and reading thresholds corresponding to respective pixels by an amount corresponding to the number of output gradations of the printer.
The multi-level dither method further includes comparing the readout thresholds, whose number is equal to the number of output gradations of the printer, with the respective pixel values to attain conversion into the number of output gradations of the printer. However, according to this method, it is necessary to store a plurality of threshold matrices whose number is equal to the number of output gradations. If the resolution of the printer is doubled, a memory amount required for the threshold matrices is four times as large as a memory amount required for a non-doubled printer. It is, therefore, difficult to reduce the cost of the printer and increase the resolution.
On the other hand, as discussed in Japanese Patent Application Laid-Open No. 2000-244734, there is a conventional method for realizing a multi-level dither method that does not use threshold matrices the total number of which is equal to the number of output gradations of the printer. This method uses a basic dither matrix and a multi-valued table that can be obtained based on offset values. According to this method, the multi-level dither method can be realized without using a plurality of threshold matrices the total number of which is equal to the number of output gradations of the printer.
A conventional technique discussed in Japanese Patent Application Laid-Open No. 11-328389 changes image data of 256 gradations to image data of 16 gradations by adding random numbers (e.g., 0 to 16) to the pixel values of the image data and then dividing summed-up values by 17.
However, according to the method discussed in Japanese Patent Application Laid-Open No. 2000-244734, the offset values are uniform irrespective of the position in the basic dither matrix and an increment amount of an output value does not change depending on the position in the matrix. On the other hand, according to the method discussed in Japanese Patent Application Laid-Open No. 11-328389, divisors are constant and, therefore, the increment amount of the output value does not change depending on the position in the matrix.
If the increment amount of the output value cannot be changed for each pixel position, the following problem may arise. In a case where a printer is an electrophotographic type, a photosensitive member is irradiated with a recording laser beam and causes a toner charged to have a positive potential to adhere to a region whose electric potential is equal to or less than a predetermined value. Then, a toner image thus formed is transferred to a recording sheet. Thus, print image data (i.e., image data to be printed) can be expressed by printing.
FIG. 11 illustrates electric potential of a photosensitive member irradiated with a recording laser beam, in relation to respective pixels of image data to be printed. In FIG. 11, V represents an initial potential of the photosensitive member. When the electric potential decreases below Vs due to irradiation of the recording laser beam, toner particles can adhere to a recording sheet. For example, in a region 1101 illustrated in FIG. 11, the electric potential is equal to or less than Vs. The region 1101 has a size equivalent to only one pixel. Therefore, one pixel corresponding to the region 1101 can be expressed as a black region.
It is generally recognized that, in a medium density region, the image quality can be stabilized if the increment of an output value is expressed as a line-like halftone dot shape compared to a dot-like halftone dot shape.
FIGS. 12A to 12E illustrate examples of the increment of an output value of print image data in the medium density region. To increase the output value of an image illustrated in FIG. 12A, if the output value of the print image data increases in a dot-like fashion as illustrated in FIG. 12B, a print image may not be expressed as a smooth image (see FIG. 12C). On the other hand, if the output value of the print image data gradually increases as illustrated in FIG. 12D, for example, by the increments of a smaller value for respective pixels, an output value increases in a linear fashion. As a result, a print image can be expressed as a smooth image (see FIG. 12E). This is the reason why it is desired to increase the output value of the print image data in a linear fashion in the medium density region.
The reproducibility may deteriorate if, in a low-density region or in a high-density region, the increment of the output value is expressed by a line-like halftone dot shape.
FIGS. 13A and 13B illustrate two examples of the output value of the print image data that increases in the low-density region. FIG. 13A illustrates an output value of print image data that increases in a linear fashion in a low-density region. In this case, a very narrow range of the photosensitive member is irradiated with a recording laser beam as indicated by a region 1102 in FIG. 11.
The recording laser beam has a weak charge and, therefore, the electric potential of the photosensitive member does not decrease below Vs. Therefore, the output value does not increase so much, and the change may not be visually recognized on a printed result. On the other hand, if the output value increases in a dot-like fashion as illustrated in FIG. 13B, an increment of an output value can be clearly recognized. In this respect, increasing the output value in a dot-like fashion is effective.
It is now assumed to increase an output value of a white portion of an image that is almost shared by a black region, as illustrated in FIG. 14A, in the high-density region. In this case, if the output value of the image data to be printed is increased in a line state as illustrated in FIG. 14B, the white portion may not be clearly discriminated from neighboring black-color pixels and, therefore, the entire image may become dark.
As a result, a printed image may be recognized as a black region as illustrated in FIG. 14C. This is because, as indicated by a region 1103 illustrated in FIG. 11, if the clearance between two recording laser beams is excessively narrow, the minus electric charges of two beams are added in the narrow clearance and the electric potential possibly decreases below Vs. On the other hand, if the output value of the image data to be printed is increased in a dot-like pattern as illustrated in FIG. 14D, an increment of the output value in the high-density region can be clearly recognized on a printed image as illustrated in FIG. 14E.
As described above, it is necessary to combine appropriate halftone dot patterns to select the method for increasing the output value of image data to be printed depending on each density region. However, in a case where the increment amount of the output value cannot be changed for each position in the matrix, a halftone dot pattern resulting from the increment of the output value becomes uniform. Therefore, it is difficult to increase the output value so that the halftone dot pattern appears as a dot state in the low-density region, a line state in the medium density region, and a dot state in the high-density region, for example, as illustrated in FIG. 9.